<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body{
      margin: 0;
      overflow: 0;
    }
    .box{
      width: 200px;
      height: 200px;
      background-color: orange;
      margin: 0 auto;
      padding: 10px;
    }
    .item1,.item2{
      background-color: #f00;
    }

    .item1{
      /* 定位脱离标准流 */
      /* 
        position: fixed;
        left: 0;
        top: 10px; 
      */
      background-color: #0f0;

      float: left;
    }

    .item2{
      float: right;
    }

  </style>
</head>

<body>
  <div class="box">
    <div class="item1">1</div>
    <div class="item2">2</div>
  </div>
</body>

</html>